<template>
	<view>
		<view v-for="(item,index) in datalist" :key="index">
			<cardViewText :title="item.title" :isTop="item.isTop" :author="item.author" :comments="item.comments"
				:time="item.time" @click="oncardViewClick(index)">
				<template v-slot:tips>
					<view class="slotcontent" v-if="item.showSearch">
						<text class="s-lable">搜索：</text>
						<view class="borderbox"><text>{{item.s1}}</text></view>
						<view class="borderbox"><text>{{item.s2}}</text></view>
					</view>
				</template>
			</cardViewText>
		</view>
	</view>
</template>

<script>
	import cardViewText from '../../components/cardViewText.vue';
	export default {
		components: {
			cardViewText
		},
		data() {
			return {
				datalist: [{
						title: "乘势而上，续写中国奇迹新篇章——党的二十届四中全会侧记",
						isTop: true,
						author: "新华社",
						comments: 56,
						time: "2025.10.28"
					},
					{
						title: "把握历史大势，共创美好未来（观沧海）",
						isTop: false,
						author: "人民日报",
						comments: 1025,
						time: "2025.10.28"
					},
					{
						title: "黄金还能走多远？卖方高呼“第三浪启动”，230多份研报看多",
						author: "财联社",
						isTop:false,
						comments: 452,
						time: "2025.10.28",
						showSearch: true, 
						s1: "今日金价",
						s2: "精选好物"
					},
					{
						title: "发挥亚太引领作用，习近平这样强调",
						isTop: false,
						author: "人民日报",
						comments: 187,
						time: "2025.10.31"
					}
				
				]

			}
		},
		methods: {

		}
	}
</script>

<style>
  .slotcontent{
			display: flex;  
			align-items: center;  
			margin-top: 10rpx;
			gap: 15rpx; 
}
.borderbox{
		border: 1rpx solid #ccc;
		border-radius: 20rpx; 
		padding: 4rpx 18rpx;
		margin-right: 15rpx;
		font-size: 24rpx;
		color: blueviolet

}
.s-lable{
			font-size: 26rpx;
			color: blueviolet;
			margin-right: 15rpx
			
}
</style>